package com.yangle.frame.admin.mapper;

import com.yangle.frame.MyMapper;
import com.yangle.frame.admin.entity.FrameUser;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

/**
 * Created by yangle on 2017/9/24.
 */
@Mapper
    public interface FrameUserMapper extends MyMapper<FrameUser> {
    @Select("select * from frame_user where id=#{id}")
    FrameUser getUserById(@Param("id") String id);

    @Select("select * from frame_user where userid=#{userid}")
    FrameUser getUserByName(@Param("userid") String userid);

    @Select("select * from user")
    List<Map<String,Object>> getUsers();

    @Insert("insert into frame_user values(#{id},#{email},#{username},#{password},#{telephone},#{address},#{areacode},#{status},#{identifystatus},#{userid})")
    void create(FrameUser frameUser);

    @Update("update frame_user set identifystatus=#{identifystatus} where id=#{id}")
    void updateIdentifystatus(String id, int identifystatus);
}
